import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const createRouter = () => new Router({
  // mode: 'history',
  routes: [{
      path: '/',
      name: 'logins',
      hidden: false,
      redirect: '/Login',
      meta: {
        title: '登录'
      }
    },
    {
      path: '/Login',
      name: 'login',
      hidden: false,
      meta: {
        title: '登录'
      },
      component: () =>
        import('@/views/base/Login.vue'),
    },
    {
      path: '/Home',
      name: 'home',
      component: () =>
        import('@/views/base/Home.vue'),
      meta: {
        title: '主页'

      }
    },
    {
      path: '/404',
      name: '404',
      hidden: false,
      component: () =>
        import('@/views/base/404.vue'),
      meta: {
        title: '404'
      }
    },
    {
      path: '*',
      name: 'red-404',
      hidden: false,
      redirect: '/404',
      meta: {
        title: '404'
      }
    }
  ]
})
const router = createRouter()
// export function resetRouter() {
//   const newRouter = createRouter()
//   router.matcher = newRouter.matcher
// }

export default router